package com.sinosoft.service.impl;

import com.sinosoft.dao.CustomerdoMapper;
import com.sinosoft.domain.Customerdo;
import com.sinosoft.service.CustomerdoService;
import com.sinosoft.utils.JsonData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: WangShengJie
 * @Date: 2025/2/13
 */
@Service
@Slf4j
public class CustomerdoServiceImpl implements CustomerdoService {

    @Autowired
    private CustomerdoMapper customerdoMapper;

    @Override
    public JsonData addCustomer(Customerdo customerdo) {
        log.info("进入方法了~~~~~~~~~~");
        int insert = customerdoMapper.insert(customerdo);
        if (insert > 0) {
            log.info("方法结束了~~~~~~~~~~");
            return JsonData.buildSuccess(customerdo, "操作成功！！！");
//            return JsonData.buildSuccess("操作成功！！");
        }else {
            log.info("方法结束了~~~~~~~~~~");
            return JsonData.buildError("操作失败~~");
        }
    }
}
